# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=baobab
pkgver=3.30.0
pkgrel=1
pkgdesc="A graphical directory tree analyzer"
url="https://wiki.gnome.org/Apps/DiskUsageAnalyzer"
arch=(x86_64)
license=(GPL2)
depends=(dconf gtk3 gsettings-desktop-schemas librsvg)
makedepends=(vala gobject-introspection yelp-tools appstream-glib git meson)
groups=(gnome)
_commit=f027d265603a206585228043abe9c35cf69d061c  # tags/3.30.0^0
source=("git+https://gitlab.gnome.org/GNOME/baobab.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

build() {
  arch-meson $pkgname build
  ninja -C build
}

check() {
  meson test -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build

  # https://bugs.archlinux.org/task/31861
  sed -i '/^MimeType=/d' "$pkgdir/usr/share/applications/org.gnome.baobab.desktop"
}
